<?php

if ($_COOKIE["export_ns"] == MD5('export_ns')) {

  $file = 'mailing_list.txt';

  header('Content-Description: File Transfer');
  header("Content-Type: text/plain");
  header('Expires: 0');
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Content-Disposition: attachment; filename=mailing_list.txt");
  header("Content-Length: " .filesize($file));
  header('Pragma: public');
  ob_clean();
  flush();
  @readfile($file);

}
else {

  print 'Permission denied';

}

?>